package com.yds.dubbo.hystrix.consumer;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.yds.dubbo.hystrix.api.HelloService;
import com.yds.dubbo.hystrix.consumer.action.HelloServiceConsumer;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author liuhongzhen
 * @date 2023/3/24 15:13
 */
@SpringBootApplication
@EnableHystrix
@EnableDubbo
public class ConsumerBootstrap {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(ConsumerBootstrap.class, args);

        HelloServiceConsumer application = context.getBean(HelloServiceConsumer.class);
        String result = application.doSayHello("world");

        System.out.println("result: " + result);
    }
}
